/* Menu */

.controller_menu_buttons {
    background-color: var(--comfy-input-bg);
    border-radius: 6px;
}
.controller_menu_button {
    cursor: pointer;
    font-size: 12pt;
    background-color: var(--comfy-input-bg);
    padding: 6px;
    border-radius: 6px;
}

.controller_menu_button.litup {
    color: var(--p-button-text-primary-color);
}

.hide .hideable {
    display: none;
}

.controller {
    --font-size: 12px;
    --element_width: 100%;

    --main-fore-color: #ffffff;
    --mid-fore-color: #c5c5c5;
    --muted-fore-color: #999999;

    --deep-back-color: #000000;
    --main-back-color: #1c1c1cfa;
    --second-back-color: #222222;
    --third-back-color:  #353535;

    --overlay-background:  #ffffff99;
    --overlay-foreground: #353535;

    --mute-button-color:#ff6e6e;
    --bypass-button-color: #d179ff;
    --mixed-button-color:#99aa99;

    --mute-overlay-color: #ffffff30;
    --bypass-overlay-color: #d179ff30;

    --toggle-on: #8899aa;
    --toggle-off: #333333;
    --toggle-intermediate: #556677;

    --main-border-color: rgb(53 53 53);

    --progress-color: green;
    --alien-progress-color: rgb(0, 122, 128);
    --active-color: green;

    --border_width: 4px;
    
    font-size: var(--font-size);
    height:100%;
    min-height: 42px;
    background: var(--main-back-color);
    padding: 0 4px 0 4px;
    position: absolute;
    min-width: 130px;
    overflow: clip scroll;
    border-width: var(--border_width);
    border-style: solid;
    border-color: var(--main-border-color);
    border-radius: 4px;
    z-index:999;
    scrollbar-width: auto;
    scrollbar-color: var(--third-back-color) var(--main-back-color);
    pointer-events: all;
    user-select: none;
}

.controller.small_scrollbars {
    scrollbar-width: thin;
}

.controller.hide_scrollbars {
    scrollbar-width: none;
}

.controller.collapsed {
    overflow: clip;
    min-width: 0px;
    padding: 0px;
}

.gutter_overlay {
    position: absolute;
    background-color: transparent;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index:999;
}

.gutter_overlap {
    position:absolute;
    pointer-events: none;
    background-color: #999999;
    border-radius: 2px;
}


/* Header */

.header {
    position: sticky;
    top: 0px;
    z-index: 40000;
    background: var(--second-back-color);
    display: flex;
    width: var(--element_width);
    justify-content: space-between;
    margin: 0px 0px 4px 0px;
    align-items: center;
    flex-wrap: wrap;
    z-index:1;
}

.subheader {
    width: 100%;
    display: flex;
    border-bottom: 1px solid var(--third-back-color);
    padding: 0px 4px 0px 4px;
    /*cursor: grab;*/
    padding: 4px 0px 0px 0px;
    border-bottom: 1px solid var(--main-back-color);
    margin-bottom: 2px;
    justify-content: space-between;
}

.subheader1 {
    display:flex;
}

.subheader2 {
    padding-top:2px;
    margin-bottom:0px;
}

.subheader .left {

} 

.subheader .right {

}

.subheader1 .right {
    min-width: max-content;
}

.controller.grabbed .subheader1 {
    cursor:grabbing;
}

.last { order: 100 }

.tabs.group {
    display: flex;
    justify-content: flex-start;
    flex-direction: row;
    align-items: center;
    /* allow the group to shrink */
    min-width: 0px;
    flex-shrink: 1;
    flex-grow: 1;
}
.tab { 
    --base-color: black;
    border-radius: 6px;
    padding: 2px 5px;
    border: 1px solid var(--deep-back-color);
    /*background-color: var(--base-color);
    color: var(--muted-fore-color);           set programatically*/
    cursor: pointer;
    text-align: center;
    margin: 0px 1px 4px 1px;
    max-width: fit-content;
    /* min-width, flex-basis, flex-sshrink, flex-grow all set programatically */
    text-overflow: ellipsis;
    overflow: hidden;
}
.tab.selected {

}

.tab.stack {
    box-shadow: 1px 1px var(--muted-fore-color);
}

.controller.grabbed .tab {
    cursor:grabbing;
}

.collapsed .tab {
    display: none;
    margin-bottom: 0px;
    margin-left:4px;
}
.collapsed .tab.selected {
    display: block;
}

.header_buttons {
    border-bottom: 1px solid var(--deep-back-color);
    flex-shrink: 0;
}



.header_button {
    cursor: pointer;
    font-size: 12pt;
    color: var(--mid-fore-color);
    margin: 8px 4px 0px 4px;
    top:-4px;
    position: relative;
}

.header_button.collapse_button {
    top: 4px;
}

.collapse_button {
    margin-top:0;
    padding-top: 8px;
}

.header_button.mode {

}
.header_button.mode:before {
    content: "\ea14";
}
.header_button.mode_2:before {
    content: "\e90c";
    color: var(--mute-button-color);
}
.header_button.mode_4:before {
    content: "\ea10";
    color: var(--bypass-button-color)  
}
.header_button.mode_9:before {
    content: "\e959";
    color: var(--mixed-button-color);
}


.clicked {
    color: var(--p-button-text-primary-color);
}

.being_dragged {
    opacity: 0.5;
    cursor: grabbing;
}

.extra_controls {
    height: 15px;
}

.collapsed .main { display:none;  }
.collapsed .footer { display: none; }


.empty_message {
    display: block;
    font-size: 70%;
    text-align: center;
    width: var(--element_width);
    margin-right:5px;
}

/* Node block */

.nodeblock {
    margin: 0px 0px 5px 0px;
    position: relative;
    width: var(--element_width);
    min-height: 40px;
    display:block;
    padding-bottom: 3px;
    border: 1px solid transparent;
}

.nodeblock.mode_2 {
    opacity: 0.5;
}
.nodeblock.mode_4 {
    opacity: 0.5;
}

.nodeblock.active {
    border-color: var(--active-color);
}

.nodeblock.minimised {
    min-height: unset;
    padding-bottom: 0px;
    overflow: hidden;
}

.nodeblock_titlebar {
    font-size: 80%;
    display: block;
    padding: 2px 3px 2px 2px;
    color: var(--mid-fore-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nodeblock_titlebar_right .pi {
    font-size:1.25em;
    vertical-align: middle;
}

.nodeblock_titlebar_left .pi {
    font-size:1.05em;
    top: 0.05em;
    position: relative;
}

.minimised .entry { display: none; }

.minimisedot {
    padding: 0px 0px 0px 0px;
    cursor: url(collapse.png) 8 8, zoom-out;
    position: relative;
    font-size: 125%;
    top: 1px;
}

.nodeblock.minimised  .minimisedot {
    cursor: url(expand.png) 8 8, zoom-out;
}

.titlebar_nocolor {
    border-bottom: 1px solid var(--second-back-color);
    padding-bottom: 1px;
    background-color: var(--third-back-color)
}

.nodeblock.minimised .nodeblock_titlebar {
    border-bottom: 0px;
    padding-bottom: 0px;
}

.nodeblock_draghandle {
    flex-grow: 1;
    flex-shrink: 1;
    max-width: calc(100% - 30px);
}

.nodeblock_title {
    text-align: left;
    pointer-events: none;
    padding-left: 4px;
    position: relative;
    bottom: 1px;
    overflow: clip;
    text-wrap-mode: nowrap;
    text-overflow: ellipsis;
    display: block;
}
.nodeblock_title::after {
    content: " ";
    font-size: 1.25em;
}

.nodeblock_image_panel {
    width: 100%;
    resize: vertical;
    overflow: hidden;
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    align-items: center;
    margin-top: 4px;
}

.nodeblock_image_empty {
    width: 100%;
    height: 10px;
    border: none;
    display:none;
}

.nodeblock_image_overlay {
    position: absolute;
    width: calc(100% - 8px);
    left: 4px;
    clip: rect(0, 0, 0, 0);
  /* clip: shape(top, right, bottom, left); NB 'rect' is the only available option */

}

.nodeblock.minimised .nodeblock_image_panel {
    display:none;
    height:0px !important;
}



.nodeblock .mode_button:before {
    content: "\ea14";
}

.nodeblock .mode_button_2:before {
    content: "\e90c";
    color: var(--mute-button-color);
}

.nodeblock .mode_button_4:before {
    content: "\ea10";
    color: var(--bypass-button-color)
}

/* Entry (widget) */

.entry {
    position: relative;
    padding:4px 3px 0px 3px;
}

.two_line_entry {
    display:flex;
    flex-direction:column;
}

.two_line_entry .line {
    display:flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--third-back-color);
}

.line .toggle {
    width: unset;
    padding-left:4px;
}

.line .label {
    font-size: 70%;
    flex-grow: 1;
    background-color: var(--second-back-color);
    height: 20px;
    padding: 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    text-wrap-mode: nowrap;
}

.entry_label {
    position: absolute;
    height: calc(var(--font-size) - 2px);
    top: 9px;
    padding-right: 6px;
    background: var(--second-back-color);
    color: var(--muted-fore-color);
    text-align: left;
    left: 6px;
    font-size: 70%;
    pointer-events: none;
    width: calc(var(--element_width) - 40px);
    overflow: clip;
    text-overflow: ellipsis;
    text-wrap-mode: nowrap;
}

.entry_label.text {
    background: #00000000;
}

.entry_label.combo {
    width: 20%;
    background-color: var(--second-back-color);
    padding: 4px 0px 4px 4px;
    top: 4px;
    height: 20px;
    left: 4px;
}

.entry_label.value {
    right: 20px;
    height: calc(var(--font-size) - 2px);
    top: 9px;
    color: var(--main-fore-color);
    width: calc(100% - 24px);
}

.input {
    width: 100%;
    left: 25%;
    font-size: 75%;
    background-color: var(--second-back-color);
    color: var(--main-fore-color);
    border: none;
    height: 20px;
    text-align: right;
}
.input.clickabletext {
    display: block;
    text-align: right;
    padding:  4px;
    font-size: 70%;
    width: 80%;
    left: 20%;
    position: relative;
    overflow: clip;
    text-wrap-mode: nowrap;
    text-overflow: ellipsis;
}
select.input {
    height: calc(var(--font-size) + 4px)
}

button.input {
    text-align: center;
}

textarea.input {
    height: 72px;
    resize: vertical;
    font-size: 85%;
    text-align: left;
    margin-bottom: -4px;
    padding: 3px 4px 3px 4px;
}

.input option {
    text-align:left;
}

.toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color:var(--second-back-color)
}

.toggle_label {
    font-size: 70%;
    padding-left: 4px;
}

.toggle_value {
    display: flex;
    justify-content: flex-end;
    align-items: center;   
}
.toggle_text {
    font-size: 70%;
}

.toggle_graphic {
    font-size: 80%;
    cursor: pointer;
    padding: 1px 4px 2px 4px;
}

.toggle_graphic.true {
    color: var(--toggle-on);
}

.toggle_graphic.false {
    color: var(--toggle-off);
}
.toggle_graphic.intermediate {
    color: var(--toggle-intermediate);
}

.muted .toggle_value .toggle_text {
    color: var(--muted-fore-color);
}

.muted .toggle_label {
    color: var(--muted-fore-color);
}

.muted .line {
    color: var(--muted-fore-color);
}

.muted .line .fancy_slider .fs_graphic .fs_graphic_fill {
    opacity: 50%;
}

.image_comparer_widget {
    display:flex;
    justify-content: center;
}

.image_comparer_option {
    padding: 0px 8px;
    color: var(--muted-fore-color)
}

.image_comparer_option.selected {
    color: var(--main-fore-color)
}

/* Footer */

.footer {
    width: 100%;
    height: 20px;
    display: block;
    position: absolute;
}

/* group add */

.group_add_select {
    position:absolute;
    z-index: 1001;
    background-color: var(--comfy-input-bg);
    border: thin solid var(--border-color);
    border-radius: 6px;
    padding: 4px;
}

.group_add_option {
    padding: 2px;
    cursor: pointer;
    color: var(--fg-color);
    border-bottom: 1px solid var(--border-color);
    border-left: 2px solid var(--comfy-input-bg);
}

.group_add_option:last-child {
    border-bottom: none;
}

.group_add_option:hover {
    border-left-color: var(--comfy-input-fg);
}


/* Global */

.hidden {
    display:none !important;
}

i {
    cursor: pointer;
}

.overlay {
    position: absolute;
    text-align: right;
    bottom:10px;
    background-color: var(--overlay-background);
    color: var(--overlay-foreground);
    right: 10px;
    padding: 3px;
    border-radius: 4px;
    font-size: 80%;
}

.overlay_paging {
    display:flex;
    padding-bottom: 1px;
    bottom: unset;
    top: 2.5em;
}

.overlay_paging_icon {
    font-family: 'primeicons';
    min-width: 1em;
}
.overlay_paging_text {
    text-align: center;
    min-width: 2.5em;
    padding: 0px 4px;
    position: relative;
    top: -1px;
}
.overlay_paging_icon:before {

}
.overlay_paging_icon.prev:before {
    content: "\e928";
}
.overlay_paging_icon.next:before {
    content: "\e92a";
}

.tooltip {
    position: relative;
    display: inline-block;
    z-index:1000;
  }
  
  /* Tooltip text */
  .tooltip .tooltiptext {
    visibility:hidden;
    background-color: #ffffff66;
    color: #353535;
    font-size: 70%;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    position: absolute;
    right: 0px;
    top: 20px;
  }

  .tooltip.right .tooltiptext {
    right: unset;
    left: 0px;
  }

  .controller.collapsed .tooltiptext {
    top:0px;
  }

  .progress_bar {
    position: absolute;
    background-color: var(--progress-color);
    left: 0px;
    /* top, width, height set programatically */
  }
  
  /* Show the tooltip text when you mouse over the tooltip container */
  .tooltip:hover .tooltiptext {
    visibility: visible;
  }

.read_only .mode_button {
    opacity: 0.5;
    cursor: unset;
}

.read_only .header_button {
    opacity: 0.5;
    cursor: unset;
}

.image_popup {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: black;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.image_popup_frame {
    background-color: #333333;
    /*border: thin solid #333333;*/
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.image_popup_image {
    border: 12px solid black;
    max-width: 100%;
    max-height: 100%;
    background-color: white;
    padding: 16px;
}